<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>版块列表</title>
<load href="__PUBLIC__/css/bootstrap.min.css" />
<load href="__PUBLIC__/css/main.css" />
<load href="__PUBLIC__/css/plate.css" />
<load href="__PUBLIC__/js/jquery-1.9.1.min.js" />
<load href="__PUBLIC__/js/main.js" />
<script type="text/javascript">
$(function(){
	$("select[name='typearray']").change(function(){
		var v = $(this).children('option:selected').val();
		var p = "__ACTION__/id/"+v+".html";
		location.href=p;
	})
	
	$(".plate_title").each(function(i, element) {
        var t = $(this);
		t.find("li").each(function(j, element) {
            var t1 = $(this);
			t1.mouseover(function(){
				t.siblings().find("li span").hide();
				$(this).siblings().find("span").hide();
				$(this).find("span").show();
			})
			t1.mouseout(function(){
				$(this).find("span").hide();	
			})
			t1.find("span").mouseout(function(){
				$(this).hide();	
			})
        });
    });

	$("li").each(function(i, element) {
		var t = $(this);
		if(t.find("b").length < 1){
			t.find("a.pbrowse").hide();
		}
	});

	//转交事件
	var jur = '';
	$("a.careof").click(function(){
		$('input[name="jur"]:checked').each(function(index, element) {
			jur += $(this).val()+",";
		});
		if(jur != ''){
			if(jur.indexOf(",") > 0){
				var s = jur.substring(0,jur.length-1);
			}else{
				var s = jur;
			}
			$(".user_tar").show();
			$("input[name='ma_id']").val(s);
		}
		jur = '';
		//alert($("input[name='ma_id']").val());
	})
	//关闭窗口
	$(".user_info b").click(function(){
		$("input[name='ma_id']").val(null);
		$(".user_tar").hide();
	})
	//执行转交
	$("a.user_ok").click(function(){
		var ma_id = $("input[name='ma_id']").val();
		var user_id = $(".user_info select").val();
		var geturl = $("input[name='geturl']").val();
		if(user_id !='' && ma_id != ''){
			var url = "/Admin/Manages/jur";
			var data = {
				"ma_id":ma_id,
				"user_id":user_id,
				random:Math.random()
			};
			$.ajax({
				url:url,
				data:data,
				type:"POST",
				dataType:"JSON",
				success:function (data){
					if(data.error == 0){
						alert("转交成功");
						location.href = geturl;
					}else{
						alert("转交失败");
					}
				},
			});
		}
	})
	
})
</script>
<style type="text/css">
.position-content{float: right; margin-right: 0px; color: #333; background: none; height: 30px; line-height: 30px; margin-bottom: 0px; padding: 0px;}
.position-content .searchkey{height: 28px; line-height: 28px; padding: 0px 10px; width: 200px; border-radius: 3px; border: solid 1px #ccc;}
.position-content .searchbtn{height: 28px; line-height: 26px; background-color: #00A388; color: #fff; border: none; padding: 0px 10px; border-radius: 3px;}
.careof{position: inherit; clear: both; margin-left: 12px; background-color: #00A388; color: #fff; border: none;}
.zjiao{position: fixed; width: 100%; height:42px; line-height: 42px; border-top: solid 1px #ccc; background-color: #e7e7e7; bottom: 0px;}
</style>
</head>

<body>
<!-- 用户列表开始 -->
<div class="user_tar">
	<div class="user_info" style="width: 360px; padding: 10px 20px; height: 52px;">
		<b>X</b>
		<label class="u_float">用户列表：</label>
		<select class="u_float" name="userinfo">
			<volist name="userlist" id="user">
				<option value="{$user['id']}">{$user['username']}</option>
			</volist>
		</select>
		<a class="u_float user_ok">确定</a>
		<input type="hidden" name="ma_id"/>
		<input type="hidden" name="geturl" value="{$getURL}"/>
	</div>
</div>
<!-- 用户列表结束 -->

<assign name="user_jur" value="$Think.session.userinfo.id"/>
<div class="main-frame">
	<div class="position">华人码 > 版块列表</div>

	<div class="plate_all">
		<a class="plate_bak" href="{:U('plate')}">返回</a>
		<div class="explain">说明：<b>●</b>点表示有多少个子版块数量</div>
    	<div class="plate_outline" style="margin-top: 0px;">★ {$plateinfo['plate_name']}<a href="{:U('plate_add', array('typeid' => $plateinfo['plate_type'], 'id' => $plateinfo['id'], 'sub' => 'true'))}">┣ 添加版块</a></div>
        <div class="plate_title">
        	<ul>
				<volist name="data" id="v">
					<li>{:W('Plate/get_subpalte_num', array('plateid' => $v['id']))}<a><if condition="$Thinkphp.session.userinfo.type eq 1"><input type="checkbox" value="{$v.id}" name="jur" /></if>⊙ {$v['plate_name']}</a><span><a href="{:U('plate_edit',array('id' => $v['id'], 'pedit' => 'true'))}">◆ 修改</a> <if condition="($v['userid'] eq $user_jur) or ($Thinkphp.session.userinfo.type eq 1)"><a href="{:U('plate_delete',array('id' => $v['id']))}" onclick="javascript:return del()">◆ 删除</a></if> <a href="{:U('plate_add', array('typeid' => $plateinfo['plate_type'], 'id' => $v['id'], 'sub' => 'true'))}">◆ 添加子版块</a> <a class="pbrowse" href="{:U('Manages/plate_browse', array('typeid' => $plateinfo['plate_type'], 'id' => $v['id'], 'sub' => 'true'))}">◆ 查看子版块</a> <a href="{:U('Pcontent/content_add', array('id' => $v['id']))}">◆ 添加内容</a> <a href="{:U('Pcontent/content_list', array('id' => $v['id']))}">◆ 内容列表</a></span></li>
				</volist>
            </ul>
        </div>

        
    </div>
    
</div>
<div class="zjiao"><if condition="$Thinkphp.session.userinfo.type eq 1"><a class="careof" style="color: #fff;">转交</a></if></div>

<script type="text/javascript">
function del() { 
	var msg = "您真的确定要删除吗？\n\n请确认！"; 
	return confirm(msg) == true ? true : false;
}
</script>
</body>
</html>
